package com.slaffka;

import com.slaffka.dao.UserDAO;
import com.slaffka.model._User;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * com.slaffka.model._User: v.tsapaev
 * Date: 10.02.12
 * Time: 18:10
 * To change this template use File | Settings | File Templates.
 */
public class HiServlet extends javax.servlet.http.HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        PrintWriter out = response.getWriter();
        out.print("<html><title>aabbbadd</title><body>aaa</body></html>");
       System.out.println("aaaaaaaaaaaaaaaaa");
        //DispatcherServlet a = new DispatcherServlet();
        UserDAO userDAO = new UserDAO();
        List<_User> users = userDAO.getUsers();
        System.out.println(users.size());
        for (_User user: users){
            System.out.println("user = " + user);
        }
            
    }
}
